package com.bmps.springcloud.insuredmicroservice.model.accept.response;

import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonPropertyOrder;
import org.apache.commons.lang3.builder.EqualsBuilder;
import org.apache.commons.lang3.builder.HashCodeBuilder;

import java.io.Serializable;

/**
 *  @author lyw
 *  @date 2019/07/24
 */
@JsonInclude(JsonInclude.Include.NON_NULL)
@JsonPropertyOrder({"result", "productInfo"})
public class ResponseModel implements Serializable {

    private ResponseProductInfoModel productInfo;
    private ResultModel result;

    public ResponseProductInfoModel getProductInfo() {
        return productInfo;
    }

    public void setProductInfo(ResponseProductInfoModel productInfo) {
        this.productInfo = productInfo;
    }

    public ResultModel getResult() {
        return result;
    }

    public void setResult(ResultModel result) {
        this.result = result;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o){
            return true;
        }

        if (o == null || getClass() != o.getClass()){
            return false;
        }

        ResponseModel that = (ResponseModel) o;

        return new EqualsBuilder()
                .append(productInfo, that.productInfo)
                .append(result, that.result)
                .isEquals();
    }

    @Override
    public int hashCode() {
        return new HashCodeBuilder(17, 37)
                .append(productInfo)
                .append(result)
                .toHashCode();
    }

    @Override
    public String toString() {
        return "ResponseModel{" +
                "productInfo=" + productInfo +
                ", result=" + result +
                '}';
    }
}
